import {always, buildMenu} from "@/utils/permission";

export function menuBudget(permissionCodes) {
    let o = buildMenu(permissionCodes, 'PD0053', 'budget', '/budget', 'noRedirect', 'Layout', '预算控制', 'budget')
    o.children.push(menuBudgetArchives(permissionCodes))
    o.children.push(menuBudgetLibrary(permissionCodes))
    o.children.push(menuBudgetProject(permissionCodes))
    o.children.push(menuBudgetOne(permissionCodes))
    o.children.push(menuBudgetTwo(permissionCodes))
    o.children.push(menuBudgetAdjust(permissionCodes))
    o.children.push(menuBudgetMonitor(permissionCodes))
    // o.children.push(menuBudgetStatistics(permissionCodes))
    // o.children.push(menuBudgetYsylog(permissionCodes))
    return o
}

function menuBudgetArchives(permissionCodes) {
    let o = buildMenu(permissionCodes, 'PD0054', 'archives', 'archives', 'noRedirect', 'ParentView', '基础档案', 'archives')
    o.children.push(buildMenu(permissionCodes, 'PD0055', 'budgetCatalog', 'budgetCatalog', '', 'budget/archives/budgetCatalog/index', '项目分类', 'catalog'))
    o.children.push(buildMenu(permissionCodes, 'PD0060', 'budgetKpi', 'budgetKpi', '', 'budget/archives/budgetKpi/index', '指标库', 'library'))
    o.children.push(buildMenu(permissionCodes, 'PD0067', 'budgetThirdCatalog', 'budgetThirdCatalog', '', 'budget/archives/budgetThirdCatalog/index', '三保目录', 'catalogue'))
    o.children.push(buildMenu(permissionCodes, 'PD0088', 'budgetHotCatalog', 'budgetHotCatalog', '', 'budget/archives/budgetHotCatalog/index', '热点分类', 'hot'))
    o.children.push(buildMenu(permissionCodes, 'PD0089', 'budgetItemType', 'budgetItemType', '', 'budget/archives/budgetItemType/index', '明细项目类别', 'classify'))
    o.children.push(buildMenu(permissionCodes, 'PD0090', 'budgetItemRange', 'budgetItemRange', '', 'budget/archives/budgetItemRange/index', '明细开支范围', 'range'))
    o.children.push(buildMenu(permissionCodes, 'PD0214', 'budgetCompetent', 'budgetCompetent', '', 'budget/archives/budgetCompetent/index', '预算主管部门', 'competent'))
    return o
}

function menuBudgetLibrary(permissionCodes) {
    let o = buildMenu(permissionCodes, 'PD0091', 'library', 'library', 'noRedirect', 'ParentView', '项目库', 'resource')
    o.children.push(buildMenu(permissionCodes, 'PD0131', 'alternativeLibrary', 'alternativeLibrary', '', 'budget/library/alternative/index', '备选库', 'alternative'))
    o.children.push(buildMenu(permissionCodes, 'PD0132', 'constructionLibrary', 'constructionLibrary', '', 'budget/library/construction/index', '建设库', 'abuilding'))
    o.children.push(buildMenu(permissionCodes, 'PD0133', 'executeLibrary', 'executeLibrary', '', 'budget/library/execute/index', '执行库', 'executing'))
    o.children.push(buildMenu(permissionCodes, 'PD0134', 'completeLibrary', 'completeLibrary', '', 'budget/library/complete/index', '已完结', 'lib'))
    return o
}

function menuBudgetProject(permissionCodes) {
    let o = buildMenu(permissionCodes, 'PD0092', 'project', 'project', 'noRedirect', 'ParentView', '项目申报', 'apply')
    o.children.push(buildMenu(permissionCodes, 'PD0119', 'projectOne', 'projectOne', '', 'budget/project/one/index', '一级项目申报', 'applys'))
    o.children.push(buildMenu(permissionCodes, 'PD0120', 'projectTwo', 'projectTwo', '', 'budget/project/two/index', '二级项目申报', 'applies'))
    o.children.push(buildMenu(permissionCodes, always, 'projectTwoEdit', 'projectTwoEdit', '', 'budget/project/two/edit', '二级项目申报编辑', ''))
    return o
}

function menuBudgetOne(permissionCodes) {
    let o = buildMenu(permissionCodes, 'PD0093', 'one', 'one', 'noRedirect', 'ParentView', '一上预算', 'basic-information')
    o.children.push(buildMenu(permissionCodes, 'PD0121', 'budgetOneNotice', 'budgetOneNotice', '', 'budget/project/notice/index', '预算编制通知(一上)', 'notify', {noticeType: "1"}))
    o.children.push(buildMenu(permissionCodes, 'PD0122', 'budgetOne', 'budgetOne', '', 'budget/apply/budgetOne/index', '预算编制(一上)', 'log'))
    o.children.push(buildMenu(permissionCodes, always, 'budgetOneEdit', 'budgetOneEdit', '', 'budget/apply/budgetOne/edit', '预算编制编辑(一上)', ''))
    o.children.push(buildMenu(permissionCodes, 'PD0123', 'budgetOneCollect', 'budgetOneCollect', '', 'budget/apply/budgetOneCollect/index', '预算汇总(一上)', 'collect'))
    o.children.push(buildMenu(permissionCodes, always, 'budgetOneCollectEdit1', 'budgetOneCollectEdit1', '', 'budget/apply/budgetOneCollect/edit1', '预算数据表(一上)', ''))
    o.children.push(buildMenu(permissionCodes, always, 'budgetOneCollectEdit2', 'budgetOneCollectEdit2', '', 'budget/apply/budgetOneCollect/edit2', '汇总预算数据表(一上)', ''))
    o.children.push(buildMenu(permissionCodes, always, 'budgetOneCollectEdit3', 'budgetOneCollectEdit3', '', 'budget/apply/budgetOneCollect/edit3', '部门整体绩效目标表(一上)', ''))
    o.children.push(buildMenu(permissionCodes, 'PD0124', 'budgetOneDepartmentPerformance', 'budgetOneDepartmentPerformance', '', 'budget/apply/budgetOneDepartmentPerformance/index', '部门绩效目标表(一上)', 'target'))
    o.children.push(buildMenu(permissionCodes, 'PD0125', 'budgetOneControl', 'budgetOneControl', '', 'budget/apply/budgetOneControl/index', '预算控制数(一上)', 'quota'))
    o.children.push(buildMenu(permissionCodes, always, 'budgetOneControlEdit', 'budgetOneControlEdit', '', 'budget/apply/budgetOneControl/edit', '预算控制数编辑(一上)', ''))
    return o
}

function menuBudgetTwo(permissionCodes) {
    let o = buildMenu(permissionCodes, 'PD0094', 'two', 'two', 'noRedirect', 'ParentView', '二上预算', 'information-maintenance')
    o.children.push(buildMenu(permissionCodes, 'PD0126', 'budgetTwoNotice', 'budgetTwoNotice', '', 'budget/project/notice/index', '预算编制通知(二上)', 'notify', {noticeType: "2"}))
    o.children.push(buildMenu(permissionCodes, 'PD0127', 'budgetTwo', 'budgetTwo', '', 'budget/apply/budgetTwo/index', '预算编制(二上)', 'log'))
    o.children.push(buildMenu(permissionCodes, always, 'budgetTwoEdit', 'budgetTwoEdit', '', 'budget/apply/budgetTwo/edit', '预算编制编辑(二上)', ''))
    o.children.push(buildMenu(permissionCodes, 'PD0128', 'budgetTwoCollect', 'budgetTwoCollect', '', 'budget/apply/budgetTwoCollect/index', '预算汇总(二上)', 'collect'))
    o.children.push(buildMenu(permissionCodes, always, 'budgetTwoCollectEdit1', 'budgetTwoCollectEdit1', '', 'budget/apply/budgetTwoCollect/edit1', '预算数据表(二上)', ''))
    o.children.push(buildMenu(permissionCodes, always, 'budgetTwoCollectEdit2', 'budgetTwoCollectEdit2', '', 'budget/apply/budgetTwoCollect/edit2', '汇总预算数据表(二上)', ''))
    o.children.push(buildMenu(permissionCodes, always, 'budgetTwoCollectEdit3', 'budgetTwoCollectEdit3', '', 'budget/apply/budgetTwoCollect/edit3', '部门整体绩效目标表(二上)', ''))
    o.children.push(buildMenu(permissionCodes, 'PD0129', 'budgetTwoDepartmentPerformance', 'budgetTwoDepartmentPerformance', '', 'budget/apply/budgetTwoDepartmentPerformance/index', '部门绩效目标表(二上)', 'target'))
    o.children.push(buildMenu(permissionCodes, 'PD0130', 'budgetTwoControl', 'budgetTwoControl', '', 'budget/apply/budgetTwoControl/index', '预算批复(二上)', 'approval'))
    o.children.push(buildMenu(permissionCodes, always, 'budgetTwoControlEdit', 'budgetTwoControlEdit', '', 'budget/apply/budgetTwoControl/edit', '预算批复编辑(二上)', ''))
    return o
}

function menuBudgetAdjust(permissionCodes) {
    let o = buildMenu(permissionCodes, 'PD0095', 'adjust', 'adjust', 'noRedirect', 'ParentView', '年中预算及调整', 'information-adjust')
    o.children.push(buildMenu(permissionCodes, 'PD0135', 'budgetModifyNotice', 'budgetModifyNotice', '', 'budget/project/notice/index', '预算调整通知', 'notify', {noticeType: "3"}))
    o.children.push(buildMenu(permissionCodes, 'PD0136', 'budgetNew', 'budgetNew', '', 'budget/adjust/budgetNew/index', '年中新预算', 'new'))
    o.children.push(buildMenu(permissionCodes, always, 'budgetNewEdit', 'budgetNewEdit', '', 'budget/adjust/budgetNew/edit', '年中新预算编辑', ''))
    o.children.push(buildMenu(permissionCodes, 'PD0137', 'budgetModify', 'budgetModify', '', 'budget/adjust/budgetModify/index', '年中预算调整', 'adjust'))
    o.children.push(buildMenu(permissionCodes, always, 'budgetModifyEdit', 'budgetModifyEdit', '', 'budget/adjust/budgetModify/edit', '年中预算调整编辑', ''))
    return o
}

function menuBudgetMonitor(permissionCodes) {
    let o = buildMenu(permissionCodes, 'PD0096', 'monitors', 'monitors', 'noRedirect', 'ParentView', '绩效监控', 'information-adjust')
    o.children.push(buildMenu(permissionCodes, 'PD0139', 'monitor', 'monitor', '', 'budget/adjust/monitor/index', '年中绩效监控', 'checked'))
    o.children.push(buildMenu(permissionCodes, 'PD0140', 'selfevaluation', 'selfevaluation', '', 'budget/adjust/self/index', '绩效自评', 'evaluation'))
    return o
}

function menuBudgetStatistics(permissionCodes) {
    let o = buildMenu(permissionCodes, 'PD0097', 'statistics', 'statistics', 'noRedirect', 'ParentView', '统计报表', 'system-data')
    o.children.push(buildMenu(permissionCodes, 'PD0141', 'departmentPerformance', 'departmentPerformance', '', 'budget/statistics/departmentPerformance/index', '部门整体绩效目标表', 'targeter'))
    o.children.push(buildMenu(permissionCodes, always, 'departmentPerformancePreview', 'departmentPerformancePreview', '', 'budget/statistics/departmentPerformance/preview', '部门整体绩效目标表预览', ''))
    o.children.push(buildMenu(permissionCodes, 'PD0142', 'budgetPerformance', 'budgetPerformance', '', 'budget/statistics/budgetPerformance/index', '项目预算绩效表', 'budgets'))
    o.children.push(buildMenu(permissionCodes, always, 'budgetPerformancePreview', 'budgetPerformancePreview', '', 'budget/statistics/budgetPerformance/preview', '项目预算绩效表预览', ''))
    o.children.push(buildMenu(permissionCodes, 'PD0143', 'projectDetails', 'projectDetails', '', 'budget/statistics/projectDetails/index', '项目明细表', 'details'))
    o.children.push(buildMenu(permissionCodes, 'PD0144', 'governmentProcurement', 'governmentProcurement', '', 'budget/statistics/governmentProcurement/index', '政府采购表', 'shoppingcart'))
    return o
}

function menuBudgetYsylog(permissionCodes) {
    let o = buildMenu(permissionCodes, 'PD0138', 'ysylog', 'ysylog', 'noRedirect', 'ParentView', '预算域对接', 'cascader')
    o.children.push(buildMenu(permissionCodes, 'PD0145', 'ysyConfig', 'ysyConfig', '', 'budget/ysy/ysyConfig/index', '预算域配置', 'information-adjust'))
    o.children.push(buildMenu(permissionCodes, 'PD0146', 'ysyLogin', 'ysyLogin', '', 'budget/ysy/ysyLogin/index', '登录记录', 'nested'))
    o.children.push(buildMenu(permissionCodes, 'PD0147', 'ysyProjectTwoSync', 'ysyProjectTwoSync', '', 'budget/ysy/ysyProjectTwoSync/index', '二级项目同步', 'sync1'))
    o.children.push(buildMenu(permissionCodes, 'PD0148', 'ysyBudgetOneSync', 'ysyBudgetOneSync', '', 'budget/ysy/ysyBudgetOneSync/index', '一上编制数据同步', 'sync2'))
    o.children.push(buildMenu(permissionCodes, 'PD0149', 'ysyBudgetTwoSync', 'ysyBudgetTwoSync', '', 'budget/ysy/ysyBudgetTwoSync/index', '二上编制数据同步', 'sync3'))
    return o
}
